package com.quicks.beauty.server.service;

import com.quicks.beauty.core.dao.BeautyCompanyMapper;
import com.quicks.beauty.core.dao.CompanyExchangeMapper;
import com.quicks.beauty.core.entity.BeautyCompany;
import com.quicks.beauty.core.vo.ComExchangeVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CompanyService {

    @Autowired
    private BeautyCompanyMapper companyMapper;

    public BeautyCompany getFirstCompany() {
        BeautyCompany firstCompany = companyMapper.getFirstCompany();
        return firstCompany;
    }

    @Autowired
    private CompanyExchangeMapper exchangeMapper;

    public List<ComExchangeVO> getLatestExchange(){
        List<ComExchangeVO> ex = exchangeMapper.getLatestEx();
        if (ex.isEmpty()) {
            ComExchangeVO vo = new ComExchangeVO();
            vo.setCompanyName("快美").setExchange(1)
                    .setDescription("1.您在快美指定机构（北京延世医疗美容诊所、SY发型工作室、眼色·美睫小站、爱茉凯德mall望京店、Zoual晏缇·北京望京店、长清老师人像摄影）的消费凭证，可兑换成美颜值，用于兑换快美礼品；\n" +
                            "\n" +
                            "2.所上传的消费凭证照片必须清晰，机构名称、日期、消费金额不能遮挡，P图无效；\n" +
                            "\n" +
                            "3.每日上传次数上限10次，请勿重复上传\n" +
                            "\n");
            ex.add(vo);
        }
        return ex;
    }

}
